package EX1;
//创建一个User类
class User{
    //属性
    private int account;
    private String password;
    private String email;
    //构造对象
    public User(int account,String password,String email){
        this.account=account;
        this.password=password;
        this.email=email;
    }
    //重载构造对象，省略邮箱
    public User(int account,String password){
        this.account=account;
        this.password=password;
        this.email="";
    }
    //对象信息展示
    void Show(){
        System.out.println("Account:"+account+" Password:"+password);//账号密码必填
        //邮箱选填
        if(!email.isEmpty()){
            System.out.println("Email:"+email);
        }
        System.out.println();
    }
};
public class Exercise3 {
    public static void main(String[] args) {
        User user1 = new User(127702, "abc127702", "127702@qq.com");
        User user2 = new User(3224418, "abc3224418");
        System.out.println("User1:");
        user1.Show();
        System.out.println("User2:");
        user2.Show();
    }
}
